import axios from 'axios'
import { ImagePreview } from 'vant';
import { BackData } from '@/api/index'
import vueConfig from '../../vue.config';
export default {
    install: function (Vue, options) {
        Vue.prototype.$uplod = function (formData, Callback) {
            axios({
                url: 'http://eskkkh.cn//api/User/UploadImg',
                method: 'POST',
                data: formData,
                headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
            }).then(res => {
                Callback(res)
            }).catch(error => {
                Callback(res)
            })

        }
        Vue.prototype.$target = function (url) {
            window.open(url)
        }
        Vue.prototype.$ImagePreview = function (images) {
            if (typeof images == Object) {
                ImagePreview(images);
            } else {
                ImagePreview([images]);
            }

        }
    }
}
